package mysql

import (
	"gorm.io/gorm"
)

type Scenic struct {
	gorm.Model
	ScenicName    string  `gorm:"type:varchar(50);not null;comment:'景点名称'"`
	BusinessHours string  `gorm:"type:varchar(50);not null;comment:'景点营业区间'"`
	ScenicPrice   float64 `gorm:"type:double(10,2);not null;comment:'景点票价'"`
	ScenicAddress string  `gorm:"type:varchar(100);not null;comment:'景点地址'"`
	Inter         string  `gorm:"type:varchar(100);not null;comment:'景点描述'"`
	ScenicScore   float64 `gorm:"type:double(10,1);not null;comment:'景点评分'"`
	Num           int     `gorm:"type:int(10);not null;comment:'库存'"`
}

func (s *Scenic) ScenicShow(id int) (result *Scenic, err2 error) {
	DB.Debug().Where("id = ?", id).Limit(1).Find(&result)
	return
}
